public class Demo1 {
    public static void main(String[] args) {
        Object locker = new Object();

        Thread thread = new Thread(() -> {
            synchronized(locker) {
                synchronized(locker) {//可重入
                    System.out.println(Thread.currentThread().getName());
                }
            }
        });
        thread.start();
    }
}
